package com.thread.thread;

/**
 * @author wangyingjie
 * @date
 * @remark
 */
public class MyThread extends Thread {

    @Override
    public void run() {
        for (int i = 0; i < 100; i++) {
            System.out.println(getName()+"===> "+i);
        }
    }

    public static void main(String[] args) {//主线程

        for (int i = 0; i < 100; i++) {
            System.out.println(Thread.currentThread().getName()+"===> "+i);
            if (i == 20) {
                new MyThread().start();//线程0
                new MyThread().start();//线程1
            }
        }
    }
}
